class SpeechController < ApplicationController
  require 'lib/speech'
  before_filter :get_speaker
  def index
    if request.post?
      @speech.set_voice(params[:voice_index].to_i)
      @speech.speak(params[:text])
    end
  end

  def get_speaker
    @speech = CocoaSpeak.new
  end
end
